<template>
  <div class="right">right组件 ---接收数据：{{num}}</div>
</template>

<script>
import bus from './EventBus.js';
export default {
  name: 'MyRight',
  data() {
    return {
      num: 0
    };
  },
  created() {
    bus.on('countChange', count => {
      this.num = count;
    });
  }
};
</script>

<style scoped>
.right {
  height: 200px;
}
</style>